<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta http-equiv="cache-control" content="no-cache">
<title>setop.h File Reference</title>
<link href="doxygen_tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="doxygen_content.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="top">
 <div id="titlearea">
  <table height="72px" width="100%" cellspacing="0" cellpadding="0">
   <tbody>
    <tr>
     <td width="10%">&nbsp;</td>
     <td><a href="https://github.com/Genivia/RE-flex"><img src="reflex-logo.png"/></a></td>
     <td>
      <div style="float: right; font-size: 18px; font-weight: bold;">setop.h File Reference</div>
      <br>
      <div style="float: right; font-size: 10px;">updated Fri Nov 22 2019 by Robert van Engelen</div>
     </td>
     <td width="10%">&nbsp;</td>
    </tr>
   </tbody>
  </table>
 </div>
<!-- Generated by Doxygen 1.8.11 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_bb8a7beb94a1b7afd52842cbf47ddd3e.html">reflex</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#namespaces">Namespaces</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">setop.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>RE/flex operations on STL containers and sets.  
<a href="#details">More...</a></p>
<div class="textblock"><div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="setop_8h__dep__incl.png" border="0" usemap="#setop_8hdep" alt=""/></div>
<map name="setop_8hdep" id="setop_8hdep">
<area shape="rect" id="node2" href="pattern_8h.html" title="RE/flex regular expression pattern compiler. " alt="" coords="57,80,131,107"/>
<area shape="rect" id="node3" href="matcher_8h.html" title="RE/flex matcher engine. " alt="" coords="5,155,87,181"/>
<area shape="rect" id="node4" href="reflex_8h.html" title="RE/flex scanner generator replacement for Flex/Lex. " alt="" coords="111,155,176,181"/>
<area shape="rect" id="node5" href="reflex_8cpp.html" title="RE/flex scanner generator replacement for Flex/Lex. " alt="" coords="103,229,183,256"/>
</map>
</div>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structreflex_1_1lazy__intersection.html">reflex::lazy_intersection&lt; S1, S2 &gt;</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intersection of two ordered sets, with an iterator to get elements lazely.  <a href="structreflex_1_1lazy__intersection.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structreflex_1_1lazy__intersection_1_1iterator.html">reflex::lazy_intersection&lt; S1, S2 &gt;::iterator</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Iterator to lazely get elements of a set intersection.  <a href="structreflex_1_1lazy__intersection_1_1iterator.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structreflex_1_1lazy__union.html">reflex::lazy_union&lt; S1, S2 &gt;</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Union of two ordered sets, with an iterator to get elements lazely.  <a href="structreflex_1_1lazy__union.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structreflex_1_1lazy__union_1_1iterator.html">reflex::lazy_union&lt; S1, S2 &gt;::iterator</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Iterator to lazely get elements of a set union.  <a href="structreflex_1_1lazy__union_1_1iterator.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:namespacereflex"><td class="memItemLeft" align="right" valign="top"> &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacereflex.html">reflex</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a3deed9d6b147d91074913f47c330d232"><td class="memTemplParams" colspan="2">template&lt;typename S1 , typename S2 &gt; </td></tr>
<tr class="memitem:a3deed9d6b147d91074913f47c330d232"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacereflex.html#a3deed9d6b147d91074913f47c330d232">reflex::is_disjoint</a> (const S1 &amp;s1, const S2 &amp;s2)</td></tr>
<tr class="memdesc:a3deed9d6b147d91074913f47c330d232"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if sets <code>s1</code> and <code>s2</code> are disjoint.  <a href="namespacereflex.html#a3deed9d6b147d91074913f47c330d232">More...</a><br /></td></tr>
<tr class="separator:a3deed9d6b147d91074913f47c330d232"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a53a990336f7c3c72595d034bd685ee5c"><td class="memTemplParams" colspan="2">template&lt;typename T , typename S &gt; </td></tr>
<tr class="memitem:a53a990336f7c3c72595d034bd685ee5c"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacereflex.html#a53a990336f7c3c72595d034bd685ee5c">reflex::is_in_set</a> (const T &amp;x, const S &amp;s)</td></tr>
<tr class="memdesc:a53a990336f7c3c72595d034bd685ee5c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if value <code>x</code> is in set <code>s</code>.  <a href="namespacereflex.html#a53a990336f7c3c72595d034bd685ee5c">More...</a><br /></td></tr>
<tr class="separator:a53a990336f7c3c72595d034bd685ee5c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a088abc7ab84436832139b9c106cad426"><td class="memTemplParams" colspan="2">template&lt;typename S1 , typename S2 &gt; </td></tr>
<tr class="memitem:a088abc7ab84436832139b9c106cad426"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacereflex.html#a088abc7ab84436832139b9c106cad426">reflex::is_subset</a> (const S1 &amp;s1, const S2 &amp;s2)</td></tr>
<tr class="memdesc:a088abc7ab84436832139b9c106cad426"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if set <code>s1</code> is a subset of set <code>s2</code>.  <a href="namespacereflex.html#a088abc7ab84436832139b9c106cad426">More...</a><br /></td></tr>
<tr class="separator:a088abc7ab84436832139b9c106cad426"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae6f035f9bac92cfcc709fd34844805d4"><td class="memTemplParams" colspan="2">template&lt;typename S1 , typename S2 &gt; </td></tr>
<tr class="memitem:ae6f035f9bac92cfcc709fd34844805d4"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacereflex.html#ae6f035f9bac92cfcc709fd34844805d4">reflex::set_insert</a> (S1 &amp;s1, const S2 &amp;s2)</td></tr>
<tr class="memdesc:ae6f035f9bac92cfcc709fd34844805d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Insert set <code>s2</code> into set <code>s1</code>.  <a href="namespacereflex.html#ae6f035f9bac92cfcc709fd34844805d4">More...</a><br /></td></tr>
<tr class="separator:ae6f035f9bac92cfcc709fd34844805d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a677294e5ecf35a97b41e72370672f3bc"><td class="memTemplParams" colspan="2">template&lt;typename S1 , typename S2 &gt; </td></tr>
<tr class="memitem:a677294e5ecf35a97b41e72370672f3bc"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacereflex.html#a677294e5ecf35a97b41e72370672f3bc">reflex::set_delete</a> (S1 &amp;s1, const S2 &amp;s2)</td></tr>
<tr class="memdesc:a677294e5ecf35a97b41e72370672f3bc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Delete elements of set <code>s2</code> from set <code>s1</code>.  <a href="namespacereflex.html#a677294e5ecf35a97b41e72370672f3bc">More...</a><br /></td></tr>
<tr class="separator:a677294e5ecf35a97b41e72370672f3bc"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>RE/flex operations on STL containers and sets. </p>
<dl class="section author"><dt>Author</dt><dd>Robert van Engelen - <a href="#" onclick="location.href='mai'+'lto:'+'eng'+'el'+'en@'+'ge'+'niv'+'ia'+'.co'+'m'; return false;">engel<span style="display: none;">.nosp@m.</span>en@g<span style="display: none;">.nosp@m.</span>enivi<span style="display: none;">.nosp@m.</span>a.co<span style="display: none;">.nosp@m.</span>m</a> </dd></dl>
<dl class="section copyright"><dt>Copyright</dt><dd>(c) 2015-2017, Robert van Engelen, Genivia Inc. All rights reserved. </dd>
<dd>
(c) BSD-3 License - see LICENSE.txt</dd></dl>
<h2>Usage </h2>
<p><code><a class="el" href="namespacereflex.html#a3deed9d6b147d91074913f47c330d232" title="Check if sets s1 and s2 are disjoint. ">reflex::is_disjoint</a>&lt;S1,S2&gt;(S1 s1, S2 s2)</code> is true if <code>s1</code> and <code>s2</code> are disjoint sets.</p>
<p><code><a class="el" href="namespacereflex.html#a088abc7ab84436832139b9c106cad426" title="Check if set s1 is a subset of set s2. ">reflex::is_subset</a>&lt;S1,S2&gt;(S1 s1, S2 s2)</code> is true if <code>s1</code> is a subset of <code>s2</code>.</p>
<p><code><a class="el" href="namespacereflex.html#a53a990336f7c3c72595d034bd685ee5c" title="Check if value x is in set s. ">reflex::is_in_set</a>&lt;T,S&gt;(T x, S s)</code> is true if <code>x</code> is in <code>s</code>.</p>
<p><code><a class="el" href="namespacereflex.html#ae6f035f9bac92cfcc709fd34844805d4" title="Insert set s2 into set s1. ">reflex::set_insert</a>&lt;S1,S2&gt;(S1 s1, S2 s2)</code> inserts elements of <code>s2</code> into <code>s1</code>.</p>
<p><code><a class="el" href="namespacereflex.html#a677294e5ecf35a97b41e72370672f3bc" title="Delete elements of set s2 from set s1. ">reflex::set_delete</a>&lt;S1,S2&gt;(S1 s1, S2 s2)</code> deletes elements of <code>s2</code> from <code>s1</code>.</p>
<p><code><a class="el" href="structreflex_1_1lazy__intersection.html" title="Intersection of two ordered sets, with an iterator to get elements lazely. ">reflex::lazy_intersection</a>&lt;S1,S2&gt;(S1 s1, S2 s2)</code> is a structure with an iterator over elements that are in <code>s1</code> and in <code>s2</code>.</p>
<p><code><a class="el" href="structreflex_1_1lazy__union.html" title="Union of two ordered sets, with an iterator to get elements lazely. ">reflex::lazy_union</a>&lt;S1,S2&gt;(S1 s1, S2 s2)</code> is a structure with an iterator over elements that are in <code>s1</code> or in <code>s2</code>.</p>
<p>The rationale for using <code><a class="el" href="structreflex_1_1lazy__intersection.html" title="Intersection of two ordered sets, with an iterator to get elements lazely. ">reflex::lazy_intersection</a></code> and <code><a class="el" href="structreflex_1_1lazy__union.html" title="Union of two ordered sets, with an iterator to get elements lazely. ">reflex::lazy_union</a></code> is to save memory when the results do not need to be stored in a set, since the elements are lazely produced by an iterator.</p>
<h2>Example </h2>
<div class="fragment"><div class="line">std::set&lt;int&gt; s1;</div><div class="line">s1.insert(1);</div><div class="line">assert(<a class="code" href="namespacereflex.html#a53a990336f7c3c72595d034bd685ee5c">reflex::is_in_set</a>(1, s1) == <span class="keyword">true</span>);</div><div class="line">std::set&lt;int&gt; s2;</div><div class="line">s2.insert(1);</div><div class="line">s2.insert(2);</div><div class="line">assert(<a class="code" href="namespacereflex.html#a3deed9d6b147d91074913f47c330d232">reflex::is_disjoint</a>(s1, s2) == <span class="keyword">false</span>);</div><div class="line">assert(<a class="code" href="namespacereflex.html#a088abc7ab84436832139b9c106cad426">reflex::is_subset</a>(s1, s2) == <span class="keyword">true</span>);</div><div class="line"><a class="code" href="structreflex_1_1lazy__union.html">reflex::lazy_union&lt; std::set&lt;int&gt;</a>,std::set&lt;int&gt; &gt; U(s1, s2);</div><div class="line"><span class="keywordflow">for</span> (<a class="code" href="structreflex_1_1lazy__union.html">reflex::lazy_union</a>&lt; std::set&lt;int&gt;,std::set&lt;int&gt; &gt;::iterator i = U.<a class="code" href="structreflex_1_1lazy__union.html#a47a05bc28ed049cf43b62df4e14e5f53">begin</a>(); i != U.end(); ++i)</div><div class="line">  std::cout &lt;&lt; *i &lt;&lt; std::endl; <span class="comment">// prints 1 and 2</span></div><div class="line"><a class="code" href="structreflex_1_1lazy__intersection.html">reflex::lazy_intersection&lt; std::set&lt;int&gt;</a>,std::set&lt;int&gt; &gt; I(s1, s2);</div><div class="line"><span class="keywordflow">for</span> (<a class="code" href="structreflex_1_1lazy__intersection.html">reflex::lazy_intersection</a>&lt; std::set&lt;int&gt;,std::set&lt;int&gt; &gt;::iterator i = I.<a class="code" href="structreflex_1_1lazy__intersection.html#a2473f5847b4ddb1a785d42b117f99910">begin</a>(); i != I.end(); ++i)</div><div class="line">  std::cout &lt;&lt; *i &lt;&lt; std::endl; <span class="comment">// prints 1</span></div></div><!-- fragment --> </div></div><!-- contents -->
<hr class="footer">
<address class="footer"><small>
Converted on Fri Nov 22 2019 14:30:50 by <a target="_blank" href="http://www.doxygen.org/index.html">Doxygen</a> 1.8.11</small></address>
<br>
<div style="height: 246px; background: #DBDBDB;">
</body>
</html>
